<template>
  <div id="firstRight">
    <div class="author-img">
      <router-link :to="{path:'/user',query:{user:'ture'}}">
        <img class="" src="../../../assets/img/1-1.jpeg" />
      </router-link>
      <div class="iconfont add" v-if="show" @click="clickShow">
        &#xe602;
      </div>
    </div>
    
    
    <div :class="showColor" @click="click">
      &#xe68b;
    </div>
     <div class="number">{{item.loveNumber}}</div>
     
     
    <div class="right-icon iconfont" @click="openComment">
      &#xe690;
    </div>
    <div class="number">{{item.commentNumber}}</div>
    
    
    <div class="right-icon iconfont" @click="openShare">
      &#xe72f;
    </div>
    <div class="number">{{item.sharNumber}}</div>
    
    
    <div class="around ">
      <img class="music" src="../../../assets/img/music.jpg"/>
    </div>
  </div>
</template>

<script>
export default {
  name: 'firstRight',
  props:['item','loveColor'],
  data(){
    return{
      showColor:'right-icon iconfont',
      show:true
    }
  },
  watch:{
    loveColor(){
      if(this.showColor === 'right-icon iconfont'){
        this.showColor = 'right-icon-red iconfont'
      }
    }
  },
  methods:{
    openShare(){
      this.$emit('openShare')
    },
    openComment(){
      this.$emit('openComment')
    },
    clickShow(){
      if(this.show === true){
        this.show = false
      }
    },
    click(){
      console.log("click")
      this.showColor = this.showColor==="right-icon iconfont"?"right-icon-red iconfont":"right-icon iconfont"
    }
  }
};
</script>

<style scoped>
.right-icon-red{
  color: red;
  width: 1rem;
  height: .8rem;
  margin-top: .3rem;
  text-align: center;
  line-height: .8rem;
  font-size: .5rem;
}
#firstRight{
  width: 1rem;
  height: 7rem;
  margin: 0 auto;
}
#firstRight .author-img{
  border-radius: 50%;
  border: .02rem solid #FFFFFF;
  width: 1rem;
  height: 1rem;
  position: relative;
}
#firstRight .around{
  border-radius: 50%;
  margin-top: .4rem;
  border: .02rem solid #FFFFFF;
  width: 1rem;
  height: 1rem;
  position: relative;
  animation: changDeg 2s linear 0.2s infinite;
}
#firstRight .around img,
#firstRight .author-img img{
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
}
.add{
  background-color: red;
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  position: absolute;
  bottom: -.175rem;
  left: .325rem;
  color: #FFFFFF;
  text-align: center;
  line-height: .325rem;
}
#firstRight .right-icon{
  width: 1rem;
  height: .8rem;
  margin-top: .3rem;
  text-align: center;
  line-height: .8rem;
  color: #FFFFFF;
  font-size: .5rem;
}
.number{
  font-size: .3rem;
  text-align: center;
}
@keyframes changDeg{
  0%{
    transform: rotate(0deg);
  }
  100%{
    transform: rotate(360deg);
  }
}
</style>
